﻿@using KRM.Core
@model IEnumerable<KRM.Core.vWebOrderWaitingForPart>
<div class="fieldset">
    <div class="legend"><span>Orders Waiting For Part(@((Model.FirstOrDefault() ?? new vWebOrderWaitingForPart()).PartName))</span></div>
    <div class="row-fluid">
        <div class="span12">
            <a class="btn" style="padding: 0; max-height: 30px; float: right" onclick="ExportCSVWithHead($('#tb-orderwaitingforpart'),'orderwaitingforpart.csv',$('#tb-orderwaitingforpart-head'))">
                <img src="/img/icon-exel.png" style="max-height: 30px">
            </a>
            <table class="table table-bordered table-fix krmtable tbl-selected" id="tb-orderwaitingforpart" data-height="200">
                <thead id="tb-orderwaitingforpart-head">
                    <tr>
                        <th>OrderRef</th>
                        <th>DatePlaced</th>
                        <th>PartId</th>
                        <th>PartName</th>
                        <th>Qty</th>
                        <th>Customer Name</th>
                        <th>Address Line 1</th>
                        <th>Address Line 2</th>
                        <th>Town</th>
                        <th>County</th>
                        <th>PostCode</th>
                        <th>Warehouse Name</th>
                        <th>Email Address</th>
                        <th>Order Item PartId</th>
                        <th>Customer WaitingId</th>

                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr onclick="loadorderwaitingforpartaction(@item.PartId, '@item.OrderRef', @item.WarehouseID)">
                            <td>@item.OrderRef</td>
                            <td>@item.DatePlaced</td>
                            <td>@item.PartId</td>
                            <td>@item.PartName</td>
                            <td>@item.Qty</td>
                            <td>@item.CustomerName</td>
                            <td>@item.AddressLine1</td>
                            <td>@item.AddressLine2</td>
                            <td>@item.Town</td>
                            <td>@item.County</td>
                            <td>@item.Postcode</td>
                            <td>@item.WarehouseName</td>
                            <td>@item.EmailAddress</td>
                            <td>@item.OrderItemPartId</td>
                            <td>@item.CustomerWaitingId</td>
                        </tr>
                    }
                </tbody>
            </table>
            <div class="row-fluid" id="orderwaitingforpart-action">
            </div>
        </div>
    </div>
</div>
